<template>
    <van-nav-bar title="会员登陆" left-text="返回" left-arrow @click-left="onClickLeft" />

    <van-image position="center" round width="10rem" height="10rem"
        src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg" style="margin-left: 15rem;margin-top: 5rem;" />


    <van-form @submit="onSubmit">
        <van-cell-group inset>
            <van-field v-model="username" name="username" label="账号" placeholder="请输入账号"
                :rules="[{ required: true, message: '请输入账号' }]" />
            <van-field v-model="password" type="password" name="password" label="密码" placeholder="请输入密码"
                :rules="[{ required: true, message: '请输入正确的密码' }]" />
        </van-cell-group>
        <div style="margin: 16px;">
            <van-button round block type="primary" native-type="submit">
                登录
            </van-button>
        </div>
        <p style="text-align: center;" @click="dl">免费注册</p>
    </van-form>
</template>

<script setup>
import { useRouter ,useRoute} from 'vue-router';
import { ref } from 'vue';
const router=useRouter()
const dl =()=>{
     router.push('/reg')
}
    const username = ref('');
    const password = ref('');
    const onSubmit = (values) => {
       router.push('/reg')
    };
</script>

<style lang="scss" scoped></style>